// File:    Khoa.cs
// Author:  Administrator
// Created: Thursday, March 13, 2014 9:03:59 AM
// Purpose: Definition of Class Khoa

using System;

public class Khoa
{
   public string makhoa;
   public string tenkhoa;
   
   public System.Collections.Generic.List<Sinhvien> cO;
   
   /// <summary>
   /// Property for collection of Sinhvien
   /// </summary>
   /// <pdGenerated>Default opposite class collection property</pdGenerated>
   public System.Collections.Generic.List<Sinhvien> CO
   {
      get
      {
         if (cO == null)
            cO = new System.Collections.Generic.List<Sinhvien>();
         return cO;
      }
      set
      {
         RemoveAllCO();
         if (value != null)
         {
            foreach (Sinhvien oSinhvien in value)
               AddCO(oSinhvien);
         }
      }
   }
   
   /// <summary>
   /// Add a new Sinhvien in the collection
   /// </summary>
   /// <pdGenerated>Default Add</pdGenerated>
   public void AddCO(Sinhvien newSinhvien)
   {
      if (newSinhvien == null)
         return;
      if (this.cO == null)
         this.cO = new System.Collections.Generic.List<Sinhvien>();
      if (!this.cO.Contains(newSinhvien))
      {
         this.cO.Add(newSinhvien);
         newSinhvien.THUOC = this;
      }
   }
   
   /// <summary>
   /// Remove an existing Sinhvien from the collection
   /// </summary>
   /// <pdGenerated>Default Remove</pdGenerated>
   public void RemoveCO(Sinhvien oldSinhvien)
   {
      if (oldSinhvien == null)
         return;
      if (this.cO != null)
         if (this.cO.Contains(oldSinhvien))
         {
            this.cO.Remove(oldSinhvien);
            oldSinhvien.THUOC = null;
         }
   }
   
   /// <summary>
   /// Remove all instances of Sinhvien from the collection
   /// </summary>
   /// <pdGenerated>Default removeAll</pdGenerated>
   public void RemoveAllCO()
   {
      if (cO != null)
      {
         System.Collections.ArrayList tmpCO = new System.Collections.ArrayList();
         foreach (Sinhvien oldSinhvien in cO)
            tmpCO.Add(oldSinhvien);
         cO.Clear();
         foreach (Sinhvien oldSinhvien in tmpCO)
            oldSinhvien.THUOC = null;
         tmpCO.Clear();
      }
   }

}